package com.cuit.jifver.weibo.logic;

import java.util.ArrayList;
import java.util.Map;


public class SavedLastRequestTask {

	public static ArrayList savedLastRecorder = new ArrayList<Object>();
	public static int pastTaskId;
	public static int REQUEST_HTTP_NUM = 0;
	
	public static void requestLastTaskAgain()
	{
		if(savedLastRecorder != null && savedLastRecorder.size() == 2 && REQUEST_HTTP_NUM < 1)
		{
		//0: TaskId, 1: Map Params
		Task task = new Task((Integer)savedLastRecorder.get(0), (Map)savedLastRecorder.get(1));
		MainService.addNewTask(task);
		}
	}
	
	public static void savedLastTaskParams(int taskId, Map param)
	{
		
			if(pastTaskId == taskId)
			{
				REQUEST_HTTP_NUM++;
			}else{
				pastTaskId = taskId;
				REQUEST_HTTP_NUM = 0;
			}

			savedLastRecorder.clear();
			
			savedLastRecorder.add(taskId);
			savedLastRecorder.add(param);
		}
}
